# coding:utf-8
__author__ = 'Jarvis'
import os
basedir = os.path.abspath(os.path.dirname(__name__))

class Config:
    SECRET_KEY = os.environ.get('SECRET_KEY') or 'ZHAOXIANGLIN'
    # set token or get from environments
    TOKEN = os.getenv('WECHAT_TOKEN', 'sisivip')
    AES_KEY = os.getenv('WECHAT_AES_KEY', '9FeX9Pe43vo7ejmillCMercPzaBbvupxxi7UyfsvCjy')
    APPID = os.getenv('WECHAT_APPID', 'wxd8d7712e42eff0cb')
    APPSECRET = os.getenv('WECHAT_APPSECRET', '8b11b75234db25e4964d1a7547483170')

    @staticmethod
    def init_app(app):
        pass

class DevelopmentConfig(Config):
    DEBUG = True
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://jarvis:zxl20040906@localhost/LibWechat'
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    TABLE_PREFIX = 'xw_'

class ProductionConfig(Config):
    DEBUG = False
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://jarvis:zxl20040906@localhost/LibWechat'
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    TABLE_PREFIX = 'xw_'

config = {
    'development': DevelopmentConfig,
    'production': ProductionConfig,
    'default': DevelopmentConfig
}
